Skip to content

Conversation

@arthlr
Copy link
Contributor

@arthlr arthlr commented Apr 13, 2025

Hi there! 👋

Description

This PR introduces support for MX records for the Cloudflare provider.

  • Cloudflare can now manage MX records via the DNSEndpoint CRD.
  • Adds logic to parse MX records and extract priority and mail host
  • Extends unit tests to validate proper MX record creation and priority
  • Updates the documentation to reflect support for cloudflare in MX record management.

Fixes #5282

Checklist

  • Unit tests updated
  • End user documentation updated (docs/sources/mx-record.md)

Thanks for checking this out! 🙏
Looking forward to your feedback — happy to make any changes if needed.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 13, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @arthlr. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 13, 2025
@mloiseleur
Copy link
Collaborator

/ok-to-test
@AndrewCharlesHay @mrozentsvayg do you think you can review this PR ?

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 13, 2025
@arthlr arthlr force-pushed the feat/mx-record branch 2 times, most recently from 14185d5 to 4f51703 Compare April 13, 2025 19:08
@arthlr
Copy link
Contributor Author

arthlr commented Apr 13, 2025

/retest

registry/txt.go Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the idea to use txt registry for the txt records.
If it's not an integral part of the PR, i would postpone it until we better understand the txt registry roadmap, especially the part of deprecating old records.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove it then 👍
However, we'll need it one day (I would like to use MX and TXT records to automatically deploy sengrid-like DNS records)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using the TXT registry, specifically?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I am not using AWS and still don't want a noop registry.
Then, a TXT registry, to store the metadata of TXT records created by external-dns is must-have for my team and I.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 16, 2025
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 26, 2025
@arthlr arthlr requested a review from mrozentsvayg April 30, 2025 12:01
@mloiseleur
Copy link
Collaborator

@mrozentsvayg anything left on your side ?
@AndrewCharlesHay any comments on this PR ?

@k8s-ci-robot k8s-ci-robot added docs provider Issues or PRs related to a provider and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 30, 2025
@mloiseleur
Copy link
Collaborator

@mrozentsvayg @AndrewCharlesHay anything left for you ?

arthlr added 17 commits June 23, 2025 14:14
…struct fields and add missing test case for host validation

Signed-off-by: Arthur Le Roux <[email protected]>
…ling and ensuring proper priority and host retrieval

Signed-off-by: Arthur Le Roux <[email protected]>
… use provider methods and enhance MX record handling in tests

Signed-off-by: Arthur Le Roux <[email protected]>
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 23, 2025
Co-authored-by: Michel Loiseleur <[email protected]>
Copy link
Member

@ivankatliarchuk ivankatliarchuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

cc @mloiseleur

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 24, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ivankatliarchuk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 24, 2025
@k8s-ci-robot k8s-ci-robot merged commit e17b5ed into kubernetes-sigs:master Jun 24, 2025
14 checks passed
@ivankatliarchuk
Copy link
Member

I forget that if I approve on review, it adds auto-approval.

troll-os pushed a commit to FiligranHQ/external-dns that referenced this pull request Aug 28, 2025
* feat(cloudflare): add support for MX records

Signed-off-by: Arthur Le Roux <[email protected]>

* test(txt): add additional TXT and MX record test cases

Signed-off-by: Arthur Le Roux <[email protected]>

* feat(endpoint): implement parsing for MX and SRV records with structured targets

Signed-off-by: Arthur Le Roux <[email protected]>

* fix(txt): remove TXT record type from supported types in NewTXTRegistry

Signed-off-by: Arthur Le Roux <[email protected]>

* refactor(digitalocean): streamline MX record handling

Signed-off-by: Arthur Le Roux <[email protected]>

* refactor(cloudflare): improve error handling in change creation

Signed-off-by: Arthur Le Roux <[email protected]>

* fix(endpoint): return all parsed SRV targets instead of a single target

Signed-off-by: Arthur Le Roux <[email protected]>

* test(endpoint): add parsing tests for MX and SRV records

Signed-off-by: Arthur Le Roux <[email protected]>

* fix(endpoint): streamline MX and SRV record validation and parsing

Signed-off-by: Arthur Le Roux <[email protected]>

* fix(digital_ocean): simplify MX record parsing

Signed-off-by: Arthur Le Roux <[email protected]>

* fix(docs): update link to CRD source in MX record documentation

Signed-off-by: Arthur Le Roux <[email protected]>

* fix(cloudflare): improve error handling for MX record parsing

Signed-off-by: Arthur Le Roux <[email protected]>

* fix(cloudflare): improve error message formatting for MX record parsing

Signed-off-by: Arthur Le Roux <[email protected]>

* refactor(endpoint): rename ParseMXRecord to NewMXTarget and update references

Signed-off-by: Arthur Le Roux <[email protected]>

* fix(endpoint): update NewMXTarget to return pointer and adjust tests accordingly

Signed-off-by: Arthur Le Roux <[email protected]>

* refactor(cloudflare): consolidate proxyEnabled and proxyDisabled variable declarations

Signed-off-by: Arthur Le Roux <[email protected]>

* fix(endpoint): update TestNewMXTarget to reflect changes in MXTarget struct fields and add missing test case for host validation

Signed-off-by: Arthur Le Roux <[email protected]>

* fix(digitalocean): improve MX record handling by adjusting error handling and ensuring proper priority and host retrieval

Signed-off-by: Arthur Le Roux <[email protected]>

* refactor(endpoint): change MXTarget fields to unexported and update NewMXTarget to use them

Signed-off-by: Arthur Le Roux <[email protected]>

* refactor(cloudflare): update groupByNameAndTypeWithCustomHostnames to use provider methods and enhance MX record handling in tests

Signed-off-by: Arthur Le Roux <[email protected]>

* test(cloudflare): enhance test cover

Signed-off-by: Arthur Le Roux <[email protected]>

* refactor(endpoint): remove unused SRVTarget struct from endpoint.go

Signed-off-by: Arthur Le Roux <[email protected]>

* refactor(endpoint): rename NewMXTarget to NewMXRecord for clarity and update references

Signed-off-by: Arthur Le Roux <[email protected]>

* Update docs/sources/mx-record.md

Co-authored-by: Michel Loiseleur <[email protected]>

---------

Signed-off-by: Arthur Le Roux <[email protected]>
Co-authored-by: Michel Loiseleur <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. docs lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. provider Issues or PRs related to a provider size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: support MX record for Cloudflare provider

7 participants